package smodel;

import tcp.TCPServer;
/**
 * 
 * @author Kristopher L. Kalish, James Madison University
 * @version 1 - April 11, 2008
 * 
 * @param <T>
 */
public class MasterModel<T extends NamedModel> implements Model<T>
{
	private T         state;
	private TCPServer tcpServer;
	
	public MasterModel(int port)
	{
		tcpServer = new TCPServer(port);
		tcpServer.start();
	}

	public T getState()
	{
		return state;
	}
	
	public void setState(T state)
	{
		this.state = state;
		System.out.println("State changed..."); //debug
		tcpServer.sendToAll(state);
	}
}
